package cn.org.donald.font;

import java.awt.*;

/**
 * @author Donald
 * @since 2023-11-13 15:58:48
 **/
public class GetFont {
    public static void main(String[] args) {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

        // 获取所有可用字体的名称
        String[] fontNames = ge.getAvailableFontFamilyNames();

        // 输出字体名称
        for (String fontName : fontNames) {
            System.out.println(fontName);
        }
    }
}
